Prefer `ITREE_FOREACH` over `overlays_in`
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 5 Feb 2024 22:58:47 +0000 (17:58 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 5 Feb 2024 22:58:47 +0000 (17:58 -0500)
commit10faaa3c91045390755791c21349cd562546fdea
tree8f813e8bbc6497ff788ccf8d07addb5b4f31a736
parentaedfb4f04837ef7b6f50d6a9d833a3ec0f33b11d
Prefer `ITREE_FOREACH` over `overlays_in`

Use `ITREE_FOREACH` instead of `overlays_in` if that can save us from
allocating an array.

* src/buffer.c (overlays_in): Mark as static.
(mouse_face_overlay_overlaps): Use `ITREE_FOREACH` instead of `overlays_in`.
(disable_line_numbers_overlay_at_eob): Same, and also change return
value to a boolean.
* src/buffer.h (overlays_in): Don't declare.
* src/editfns.c (overlays_around): Delete function.
(Fget_pos_property): Use `ITREE_FOREACH` and keep the "best so far"
instead of using `overlays_in` and sorting the elements.

* src/lisp.h (disable_line_numbers_overlay_at_eob): Change return
type to a boolean.
* src/xdisp.c (should_produce_line_number): Adjust accordingly.
src/buffer.c
src/buffer.h
src/editfns.c
src/lisp.h
src/xdisp.c